using System;

namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 操作日志数据传输对象
    /// 用于操作日志的数据传输和API交互
    /// </summary>
    public class OperationLogDto
    {
        /// <summary>
        /// 操作日志标识符
        /// </summary>
        public long Id { get; set; }
        
        /// <summary>
        /// 跟踪标识符
        /// </summary>
        public string? TraceId { get; set; }
        
        /// <summary>
        /// 日志级别
        /// </summary>
        public string? LogLevel { get; set; }
        
        /// <summary>
        /// 日志消息
        /// </summary>
        public string? Message { get; set; }
        
        /// <summary>
        /// 时间戳
        /// </summary>
        public DateTime Timestamp { get; set; }
        
        /// <summary>
        /// 用户标识符
        /// </summary>
        public string? UserId { get; set; }
        
        /// <summary>
        /// 请求路径
        /// </summary>
        public string? RequestPath { get; set; }
        
        /// <summary>
        /// HTTP方法
        /// </summary>
        public string? HttpMethod { get; set; }
        
        /// <summary>
        /// 状态码
        /// </summary>
        public int? StatusCode { get; set; }
        
        /// <summary>
        /// 执行耗时（毫秒）
        /// </summary>
        public long? Duration { get; set; }
        
        /// <summary>
        /// IP地址
        /// </summary>
        public string? IpAddress { get; set; }
        
        /// <summary>
        /// 用户代理
        /// </summary>
        public string? UserAgent { get; set; }
        
        /// <summary>
        /// 请求参数
        /// </summary>
        public string? RequestParameters { get; set; }
        
        /// <summary>
        /// 响应数据
        /// </summary>
        public string? ResponseData { get; set; }
        
        /// <summary>
        /// 租户ID
        /// </summary>
        public string? TenantId { get; set; }
        
        /// <summary>
        /// 关联ID
        /// </summary>
        public string? CorrelationId { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

        /// <summary>
        /// 操作类型
        /// </summary>
        public string? OperationType { get; set; }

        /// <summary>
        /// 操作名称
        /// </summary>
        public string? OperationName { get; set; }

        /// <summary>
        /// 描述信息
        /// </summary>
        public string? Description { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        public string? UserName { get; set; }

        /// <summary>
        /// 操作是否成功
        /// </summary>
        public bool? Success { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string? ErrorMessage { get; set; }

        /// <summary>
        /// 请求数据
        /// </summary>
        public string? RequestData { get; set; }

        /// <summary>
        /// 附加数据
        /// </summary>
        public string? AdditionalData { get; set; }
    }
}
